import { axios } from '@/utils/request'

const api = {
  pageList: '/sysTestCase/pageList',
  addItem: '/sysTestCase/add',
  deleteItem: '/sysTestCase/delete',
  updateItem: '/sysTestCase/update',
  getItem: '/sysTestCase/get'
}

export default api

export function getTestCaseList (parameter) {
  return axios({
    url: api.pageList,
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: parameter
  })
}

export function addItem (parameter) {
  return axios({
    url: api.addItem,
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: parameter
  })
}

export function deleteItem (parameter) {
  return axios({
    url: api.deleteItem,
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: parameter
  })
}

export function updateItem (parameter) {
  return axios({
    url: api.updateItem,
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: parameter
  })
}

export function getItem (parameter) {
  return axios({
    url: api.getItem,
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    params: parameter
  })
}
